package edu.pw.treegrid.client.format;

import com.google.gwt.i18n.client.NumberFormat;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;

public class NumberFormatter implements CellFormatter {
	
	private NumberFormat numberFormat;
	
	public NumberFormatter(String format) {
		this.numberFormat = NumberFormat.getFormat(format);
	}

	public String format(Object value, ListGridRecord record, int rowNum,
			int colNum) {
		return this.numberFormat.format((Number)value);
	}

}
